package com.ssm.user.convert;

import com.ssm.user.entity.dto.UserDto;
import com.ssm.user.entity.dto.UserPageDto;
import com.ssm.user.entity.po.UserPo;
import com.ssm.user.entity.req.UserPageReq;
import com.ssm.user.entity.req.UserReq;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

@Mapper //mapstruct下的mapper非mybatis
public interface UserConvert {
    UserConvert INSTANCE = Mappers.getMapper(UserConvert.class); //获取代理

    //UserReq转UserDto(返回值类型为dto)
    UserDto convertReqToDto(UserReq userReq);

    //UserDto转UserPo
    UserPo convertDtoToPo(UserDto userDto);

    //UserPageReq转UserPageDto
    UserPageDto convertPageReqToPageDto(UserPageReq userPageReq);

    //UserPageDto转UserPo
    UserPo convertPageDtoToPo(UserPageDto userPageDto);
}
